using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Turquoise.EntityGenerator.Models.Mapping
{
    public class MenuItemHistoryMap : EntityTypeConfiguration<MenuItemHistory>
    {
        public MenuItemHistoryMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ActionName)
                .HasMaxLength(100);

            this.Property(t => t.ControllerName)
                .HasMaxLength(100);

            this.Property(t => t.MenuUrl)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("MenuItemHistory");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.MenuItemId).HasColumnName("MenuItemId");
            this.Property(t => t.MenuId).HasColumnName("MenuId");
            this.Property(t => t.ActionName).HasColumnName("ActionName");
            this.Property(t => t.ControllerName).HasColumnName("ControllerName");
            this.Property(t => t.MenuUrl).HasColumnName("MenuUrl");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.CreatedBy).HasColumnName("CreatedBy");
            this.Property(t => t.VersionNo).HasColumnName("VersionNo");
            this.Property(t => t.RestoreVersionNo).HasColumnName("RestoreVersionNo");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.UpdatedBy).HasColumnName("UpdatedBy");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
        }
    }
}
